package model;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Connector {

    private static String url = "jdbc:oracle:thin:@//10.105.41.142:1521/BASEDL";
    private static String user = "redline";
    private static String passwd = "redline";
    private static Connection connect = null;

    public static Connection getConnection() {
	if (connect == null) {
	    try {
		connect = DriverManager.getConnection(url, user, passwd);
	    } catch (SQLException sqle) {
		sqle.printStackTrace();
	    }
	}
	return connect;
    }

    public static boolean disconnectdb() {
	try {
	    connect.close();
	    return true;
	} catch (SQLException e) {
	    e.printStackTrace();
	    return false;
	}
    }
}
